package com.tanhua.manager.service;


import com.tanhua.domain.vo.AnalysisSummaryVo;
import com.tanhua.dubbo.api.db.AnalysisByDayApi;
import com.tanhua.dubbo.api.db.LogApi;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;

@Service
public class AnalysisByDayService {

    @Reference
    private LogApi logApi;

    @Reference
    private AnalysisByDayApi analysisByDayApi;

    public void analysis(String todayStr) {
        logApi.analysis(todayStr);
    }

    public ResponseEntity summary(String todayStr) {
        AnalysisSummaryVo analysisSummaryVo = analysisByDayApi.summary(todayStr);
        return ResponseEntity.ok(analysisSummaryVo);
    }
}
